package me.snowiest.snowdrift.entity;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.*;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

@Data
@NoArgsConstructor
@AllArgsConstructor
@TableName("archive")
public class Archive implements Serializable {
    @TableId(type = IdType.AUTO)
    private Integer id;

    @TableField
    private String name;

    @TableField
    private String description;

    @TableField
    private String suffix;

    @TableField
    private String url;

    @JSONField(serialize = false)
    @TableField(value = "gmt_create", fill = FieldFill.INSERT)
    private Date createTime;

    @JSONField(serialize = false)
    @TableField(value = "gmt_modified", fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;

    @TableLogic
    @JSONField(serialize = false)
    @TableField(fill = FieldFill.INSERT)
    private Integer deleted;

    @Version
    @JSONField(serialize = false)
    @TableField(fill = FieldFill.INSERT)
    private Integer version;

    @JSONField(deserialize = false)
    @TableField(exist = false)
    private List<Tag> tagList;
}
